<?php
$servername = "localhost";
$username = "root";
$password = "p081742linuxZH#";
$dbname = "new_schema";

$temp = $_GET['temp'];
$newTime =  date('Y-m-d H:i:s',time());

// 创建连接
$conn = new mysqli($servername, $username, $password, $dbname);
// 检测连接
if ($conn->connect_error) {
    die("连接失败: " . $conn->connect_error);
}

$sql = "INSERT INTO new_table (temp, tempTime) VALUES ( '".$temp."','".$newTime."')";

if ($conn->query($sql) === TRUE) {
    echo "新记录插入成功";
} else {
    echo "Error: " . $sql . "<br>" . $conn->error;
}

$conn->close();
?>